<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <script>
      // 1. 类的继承
      class Father {
        constructor(first, house) {
          console.log('我被调用了')
          console.log(first, house)
          this.firstName = first
          this.house = house
        }
        drink() {
          console.log('我会喝酒')
        }
      }

      class Son extends Father {
        constructor(f, h, car) {
          super(f, h)
          this.car = car
          super.drink()
        }
      }

      // const son = new Father('董', '300平方米大平层')
      const son = new Son('董', '300平方米大平层', '比亚迪汉')
      // console.log(son)
      // son.drink()
    </script>
  </body>
</html>
